﻿@using CoreData
@model IEnumerable<Merchant_Notify>
@if (Model!=null&&Model.Count() > 0)
{
    int i = 0;
    <table cellpadding="0" cellspacing="0" width="100%" class="table" id="tSortable">
        <thead>
            <tr>
                <th width="20px">
                </th>
                <th>Title
                </th>
                <th width="70px">Create date</th>
                 <th width="70px">Send date</th>
                <th>Sender
                </th>
                <td width="70px">Status</td>
                <th width="60px">Send
                </th>
                <th width="60px">Action
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                i++;
                <tr>
                    <td>
                        @i
                    </td>
                    <td>
                        <span class="SpanId" style="display: none;">@item.ID</span>
                        <span class="SpanName" style="display: none;">@item.Title</span>
                        @item.Title
                    </td>
                   
                    <td>
                        @item.CreateDate.ToShortDateString()
                    </td>
                    <td>
                      @if(item.SendDate!=DateTime.MinValue)
                      {
                          item.SendDate.ToShortDateString();
                      }
                    </td>
                    <td>@item.Sender</td>
                    
                    <td>
                       @if (item.Status==1)
                       {
                         <span class="orderlabel new-order" >Sent</span>
                       }
                       else
                       { 
                          <span class="orderlabel complete-order" >Noi sent</span> 
                       }
                    </td>
                    <td>
                    <center>
                        @Html.CheckBoxFor(x => item.Active, new { @disabled = "disabled" })
                        </center>
                    </td>
                    
                   
                    <td>
                     @if (Helper.SessionManagement.Value("pvalue").Contains("U"))
                     {
                        <a title="Sửa" href="@Url.Action("AddOrUpdate", "MerchantNotifyManagement", new { id = item.ID })" class="icon-pencil"></a>@:&nbsp; &nbsp;
                        }
                         @if (Helper.SessionManagement.Value("pvalue").Contains("D"))
                         {
                        <a title="Xóa" href="@Url.Action("Delete", "MerchantNotifyManagement", new { id = item.ID })" class="icon-trash" onclick="return confirm('Do you want delete ?');"></a>
                         }
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
else
{
    <h2 class="error-text">Not any notify here.
    </h2>
}